package router

import (
"server/application/constant/apis"
"server/application/constant/enums"
"server/application/controller/custctrl"
"server/application/db/schema/sdto"
"server/application/dto"
"server/pkg/ginp"
)

func init() {

//创建
AppendRouter(ItemInfo{
Path:           apis.ApiAccountConfigCreate,               //api路径
Handlers:       ginp.ConvHandler(custctrl.AccountConfigCreate), //对应控制器
HttpType:       HttpPost,                              //http请求类型
NeedLogin:      true,                                  //是否需要登录
NeedPermission: true,                                  //是否需要鉴权
PermissionName: "AccountConfig.create",                    //完整的权限名称,会跟权限表匹配
Swagger: &SwaggerInfo{
Title:       "创建用户自定义配置",
Description: "",
RequestDto:  sdto.AccountConfigCreate{},
},
})

//修改
AppendRouter(ItemInfo{
Path:           apis.ApiAccountConfigUpdate,               //api路径
Handlers:       ginp.ConvHandler(custctrl.AccountConfigUpdate), //对应控制器
HttpType:       HttpPost,                              //http请求类型
NeedLogin:      true,                                  //是否需要登录
NeedPermission: true,                                  //是否需要鉴权
PermissionName: "AccountConfig.update",                    //完整的权限名称,会跟权限表匹配
Swagger: &SwaggerInfo{
Title:       "修改用户自定义配置",
Description: "",
RequestDto:  sdto.AccountConfigUpdate{},
},
})

// 删除
AppendRouter(ItemInfo{
Path:           apis.ApiAccountConfigDelete,               //api路径
Handlers:       ginp.ConvHandler(custctrl.AccountConfigDelete), //对应控制器
HttpType:       HttpPost,                              //http请求类型
NeedLogin:      true,                                  //是否需要登录
NeedPermission: true,                                  //是否需要鉴权
PermissionName: "AccountConfig.delete",                    //完整的权限名称,会跟权限表匹配
Swagger: &SwaggerInfo{
Title:       "删除用户自定义配置",
Description: "",
RequestDto:  sdto.AccountConfigDelete{},
},
})

//search 搜索
AppendRouter(ItemInfo{
Path:           apis.ApiAccountConfigSearch,               //api路径
Handlers:       ginp.ConvHandler(custctrl.AccountConfigSearch), //对应控制器
HttpType:       HttpPost,                              //http请求类型
NeedLogin:      true,                                  //是否需要登录
NeedPermission: true,                                  //是否需要鉴权
PermissionName: "AccountConfig.search",                    //完整的权限名称,会跟权限表匹配
Swagger: &SwaggerInfo{
Title:       "获取用户自定义配置列表",
Description: "",
RequestDto:  dto.ReqSearch{},
},
})

AppendRouter(ItemInfo{
Path:           apis.ApiAccountConfigImport,               //api路径
Handlers:       ginp.ConvHandler(custctrl.AccountConfigImport), //对应控制器
HttpType:       HttpPost,                              //http请求类型
NeedLogin:      true,                                  //是否需要登录
NeedPermission: true,                                  //是否需要鉴权
PermissionName: "AccountConfig." + enums.BtnAuthImport,    //完整的权限名称,会跟权限表匹配
Swagger: &SwaggerInfo{
Title:       "导入用户自定义配置",
Description: "",
RequestDto:  dto.ReqSearch{},
},
})

AppendRouter(ItemInfo{
Path:           apis.ApiAccountConfigImportTemplateFile,               //api路径
Handlers:       ginp.ConvHandler(custctrl.AccountConfigImportTemplateFile), //对应控制器
HttpType:       HttpPost,                                          //http请求类型
NeedLogin:      true,                                              //是否需要登录
NeedPermission: false,                                             //是否需要鉴权
PermissionName: "AccountConfig." + enums.BtnAuthImport,                //完整的权限名称,会跟权限表匹配
Swagger: &SwaggerInfo{
Title:       "获取导入用户自定义配置模板文件",
Description: "",
},
})

AppendRouter(ItemInfo{
Path:           apis.ApiAccountConfigExport,               //api路径
Handlers:       ginp.ConvHandler(custctrl.AccountConfigExport), //对应控制器
HttpType:       HttpPost,                              //http请求类型
NeedLogin:      true,                                  //是否需要登录
NeedPermission: true,                                  //是否需要鉴权
PermissionName: "AccountConfig." + enums.BtnAuthExport,    //完整的权限名称,会跟权限表匹配
Swagger: &SwaggerInfo{
Title:       "导出用户自定义配置",
Description: "",
},
})

//{{append}}

}
